usb: ehci: only shutdown opened controller
authorPeng Fan <[email protected]>
Wed, 15 Jun 2016 05:15:46 +0000 (13:15 +0800)
committerMarek Vasut <[email protected]>
Fri, 17 Jun 2016 22:49:00 +0000 (00:49 +0200)
commit1e6fb0e367564d427d7c57fa7b3b972ecb7147a3
tree99e1a47e1964d8e87aed04b1de6d15cdd98d4d3e
parent7839f5f8092762f048076c6c7b010c10f2ee8a0b
usb: ehci: only shutdown opened controller

If the usb controller is not running, no need to shutdown it,
otherwise `usb stop` complains about:
"EHCI failed to shut down host controller".

To i.MX7D SDB, there are two usb ports, one Host, one OTG.
If we only plug one udisk to the Host port and then `usb start`,
the OTG controller for OTG port does not run actually. Then,
if `usb stop`, the OTG controller for OTG port will also be
shutdown, but it is not running.

This patch adds a check to only shutdown the running controller.

Signed-off-by: Peng Fan <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Mateusz Kulikowski <[email protected]>
Cc: Hans de Goede <[email protected]>
Cc: "Stefan BrĂ¼ns" <[email protected]>
Cc: Stephen Warren <[email protected]>
drivers/usb/host/ehci-hcd.c